<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>兑换奖品</title>
    <script src="/public/sp/js/mui.min.js"></script>
    <link href="/public/sp/css/mui.min.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/public/sp/css/style.css" />
    <link rel="stylesheet" href="/public/sp/css/iconfont.css" />
    <link rel="stylesheet" href="/public/sp/css/me.css" />
    <link rel="stylesheet" href="/public/sp/css/shoupiao.css" />
</head>
<body>
	<header class="mui-bar mui-bar-nav">
	    <h1 class="mui-title">我的奖品
	    </h1>
	</header>
	<div class="mui-content cash_content" >
		<div class="duih_top">
		    <div class="tips" style="color: #fff;">兑奖小提示：每天扫码就能领取奖品~请到相应商家兑换奖品，数量有限，先到先得</div>
	    </div>
		{if count($list)==0}
				<div class="none">
					<p class="iconfont icon-404"></p>
					<p>很抱歉，暂无记录</p>
				</div>	    		
		{/if}
	    {foreach name="list" item="l"}
	    <div class="duih_jp">
		    <div class="dhjp_conbox"><img src="{$l.thumb}"></div>
		    <div style="text-align: center;padding-top:10px; color: #Fff;">{$l.name}×{$l.nums}</div>
	    	<button  {if $l.nums<=0}disabled="disabled"{/if} data-id="{$l.item_id}"  type="button" class="duih_btn">核销</button>
	    </div>
		{/foreach}
	</div>
	
</body>
<script src="/public/static/js/jquery.min.js"></script>
<script src="/public/static/layui/layui.all.js"></script>
<script src="/public/static/js/help.js "></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js "></script>
<script>
	$(".duih_btn").click(function(){
		$(this).attr('disabled',true);
		var id=$(this).data("id");
		  	layer.confirm('您确认核销？', {
				icon: 3
			},function(index) {
					$.ajax({
			type:"post",
			url:"/index/jiangpin/ex_jp",
			data:{id:id},
			success:function(data){
				if(data.code==200){
					layer.msg(data.msg,
					{time:2*1000},function() {
					  window.location="/index/index/cash_list";
					})
				}else{
					layer.msg(data.msg);
				}
			}
		});
	
			});
	  
	})
</script>
</html>
